<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="ie=edge" />
        <title>旋转中心点案例</title>
        <style>
            div {
                overflow: hidden;
                width: 200px;
                height: 200px;
                border: 1px solid pink;
                margin: 10px;
                float: left;
            }

            div::before {
                content: "";
                display: block;
                width: 100%;
                height: 100%;
                background-color: hotpink;
                transform: rotate(180deg);
                /* 设置旋转中心点为左下角 */
                transform-origin: left bottom;
                transition: all 0.4s;
            }

            /* 鼠标经过div 里面的before 复原 */
            div:hover::before {
                transform: rotate(0deg);
            }
        </style>
    </head>

    <body>
        <div></div>
        <div></div>
        <div></div>
    </body>
</html>
